﻿// <copyright file="GameConfiguration.cs" company="SpaceRock Team Members">
// Project: SpaceRock
// File: GameConfiguration.cs (2,16 KB, 80 lines)
// Creation date: 2010-06-08 18:35
// Last modified: 2010-06-08 18:38
// </copyright>

#region Using directives
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion

namespace SpaceRockTeam.SpaceRock.Data
{
    /// <summary>
    /// Level type
    /// </summary>
    public enum LevelType
    {
        Warmup,
        NearMars,
        DeepSpace,
    }

    /// <summary>
    /// Game configuration
    /// </summary>
    public class GameConfiguration
    {
        /// <summary>
        /// Start level type
        /// </summary>
        public LevelType StartLevelType { get; set; } // StartLevelType
        
        /// <summary>
        /// Play music
        /// </summary>
        public bool PlayMusic { get; set; } // PlayMusic
        
        /// <summary>
        /// Music volume
        /// </summary>
        public uint MusicVolume { get; set; } // MusicVolume

        /// <summary>
        /// Lives count
        /// </summary>
        public uint LivesCount { get; set; } // LivesCount

        /// <summary>
        /// _current configuration
        /// </summary>
        private static GameConfiguration currentConfiguration;

        /// <summary>
        /// Get configuration
        /// </summary>
        public static GameConfiguration GetConfiguration()
        {
            if (currentConfiguration == null)
            {
                currentConfiguration = GetDefaultConfiguration();
            }
            return currentConfiguration;
        } // GetConfiguration

        /// <summary>
        /// Get default configuration
        /// </summary>
        private static GameConfiguration GetDefaultConfiguration()
        {
            GameConfiguration gameConfiguration = new GameConfiguration();
            gameConfiguration.StartLevelType = LevelType.Warmup;
            gameConfiguration.MusicVolume = 55;
            gameConfiguration.PlayMusic = true;
            gameConfiguration.LivesCount = 5;
            return gameConfiguration;
        } // GetDefaultConfiguration
    } // class GameConfiguration
} // namespace SpaceRockTeam.SpaceRock.Data
